package com.ruoyi.purchase.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.io.Serializable;
import java.util.Objects;

/**
 * 
 * @TableName po_detail
 */
//商品明细
@Data
public class DetailDemo implements Serializable {
    /**
     * 采购明细id
     */
    @TableId
    private Integer detailId;

    /**
     * 采购单编号 id外键
     */
    private String purId;

    /**
     * 商品id 外键
     */
    private Integer productId;

    /**
     * 进价
     */
    private Double buyPrice;

    /**
     * 数量
     */
    private Integer num;

    /**
     * 总金额
     */

    private Double total;
    /**
     * 订购单总金额
     */

    private Double money;
    /**
     * 商品单价
     */
    @TableField(exist = false)
    private Double price;

    /**
     * 计量单位
     */
    @TableField(exist = false)
    private String unit;

    @TableField(exist = false)
    private Integer brandId;
    @TableField(exist = false)
    private Integer typeId;
    @TableField(exist = false)
    private String productModel;
    @TableField(exist = false)
    private Integer firmId;
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DetailDemo that = (DetailDemo) o;
        return Objects.equals(detailId, that.detailId) &&
                Objects.equals(purId, that.purId) &&
                Objects.equals(productId, that.productId) &&
                Objects.equals(buyPrice, that.buyPrice) &&
                Objects.equals(num, that.num) &&
                Objects.equals(total, that.total) &&
                Objects.equals(money, that.money) &&
                Objects.equals(price, that.price) &&
                Objects.equals(unit, that.unit) &&
                Objects.equals(brandId, that.brandId) &&
                Objects.equals(typeId, that.typeId) &&
                Objects.equals(productModel, that.productModel) &&
                Objects.equals(firmId, that.firmId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(detailId, purId, productId, buyPrice, num, total, money, price, unit, brandId, typeId, productModel, firmId);
    }

}